//
//  GetOss.m
//  DentalDoc
//
//  Created by pengpeng on 16/5/12.
//  Copyright © 2016年 pengpeng. All rights reserved.
//

#import "GetOss.h"

@implementation GetOss


+ (OSSClient *)setupOSS {
    
    NSString *endpoint = @"http://oss-cn-hangzhou.aliyuncs.com";
    // 明文设置secret的方式建议只在测试时使用，更多鉴权模式请参考后面的访问控制章节
    
    id<OSSCredentialProvider> credential = [[OSSPlainTextAKSKPairCredentialProvider alloc] initWithPlainTextAccessKey:@"fdg7UR6xjikHnMS2" secretKey:@"CqhX8ojDC7OLB8ZKj5eZvpoFNx4OBz"];
    
    
    OSSClientConfiguration * conf = [OSSClientConfiguration new];
    
    conf.maxRetryCount = 3; // 网络请求遇到异常失败后的重试次数
    conf.timeoutIntervalForRequest = 30; // 网络请求的超时时间
    conf.timeoutIntervalForResource = 24 * 60 * 60; // 允许资源传输的最长时间
    
    return  [[OSSClient alloc] initWithEndpoint:endpoint credentialProvider:credential clientConfiguration:conf];
}



@end
